#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int* selfDividingNumbers(int left, int right, int* returnSize) 
{
    static int num[1000];
    int count = 0;
    int flag = 1;
    for (int i = left; i <= right; i++)
    {
        int temp = i;
        while (temp)
        {
            if (temp % 10)
            {
                if (i % (temp % 10))
                {
                    flag = 0;
                    break;
                }
            }
            else
            {
                flag = 0;
                break;
            }
            temp /= 10;
        }
        if (flag)
        {
            num[count++] = i;
        }
        flag = 1;
    }
    *returnSize = count;
    return num;
}

int main()
{
    int left = 0, right = 0;
    scanf("%d %d", &left, &right);
    int len = 0;
    int* SDN = selfDividingNumbers(left, right, &len);
    for (int i = 0; i < len; i++)
    {
        printf("%d ", SDN[i]);
    }
    return 0;
}